<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="/resources/template/template.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:p="http://primefaces.org/ui">


    <ui:define name="content">

        <h:panelGroup >
            <h:form id="form"  >
                <p:growl />


                <p:panel header="Undelete Services" >

                    <p:commandButton value="List Deleted Services" action="#{investigationController.listDeletedIxs}" ajax="false" ></p:commandButton>
                    <p:commandButton value="Undelete Selected" action="#{investigationController.undeleteSelectedIxs() }" ajax="false" ></p:commandButton>

                    <p:dataTable value="#{investigationController.deletedIxs}" var="item" rowKey="#{item.id}"
                                 paginator="true" paginatorAlwaysVisible="true"
                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                 rowsPerPageTemplate="10,30,50,100,250"
                                 rows="50"
                                 selection="#{investigationController.selectedIxs}">
                        <p:column selectionMode="multiple" style="width:16px;text-align:center"/>
                        <p:column headerText="Category" sortBy="#{item.category.name}" filterBy="#{item.category.name}" >
                            <p:outputLabel value="#{item.category.name}" ></p:outputLabel>
                        </p:column>
                        <p:column headerText="Institution"  sortBy="#{item.institution.name}" filterBy="#{item.institution.name}" >
                            <p:outputLabel value="#{item.institution.name}"></p:outputLabel>
                        </p:column>
                        <p:column headerText="Department"  sortBy="#{item.department.name}" filterBy="#{item.department.name}" >
                            <p:outputLabel value="#{item.department.name}"></p:outputLabel>
                        </p:column>
                        
                        <p:column headerText="Name"  sortBy="#{item.name}" filterBy="#{item.name}" >
                            <p:outputLabel value="#{item.name}"></p:outputLabel>
                        </p:column>
                        
                        <p:column headerText="Id"  sortBy="#{item.id}" filterBy="#{item.id}" >
                            <p:outputLabel value="#{item.id}"></p:outputLabel>
                        </p:column>
                        
                        <p:column headerText="Deleted By"  sortBy="#{item.retirer.webUserPerson.name}" 
                                  filterBy="#{item.retirer.webUserPerson.name}" >
                            <p:outputLabel value="#{item.retirer.webUserPerson.name}"></p:outputLabel>
                        </p:column>
                        <p:column headerText="Deleted At"  sortBy="#{item.retiredAt}"  >
                            <p:outputLabel value="#{item.retiredAt}">
                                <f:convertDateTime pattern="dd MMM yy hh:mm" ></f:convertDateTime>
                            </p:outputLabel>
                        </p:column>

                    </p:dataTable>

                </p:panel>
            </h:form>

        </h:panelGroup>


    </ui:define>

</ui:composition>
